package com.hst.capacity.infra.persistence.jpa.setting.line;


import com.hst.capacity.domain.model.entity.setting.line.CityLineScopeEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface CityLineScopeRepository extends JpaRepository<CityLineScopeEntity, String> {

    @Query("select t from CityLineScopeEntity t left join CityLineEntity c on t.idCityLine = c.idCityLine where c.cityCode=:cityCode and t.innercityLine = :innercityLine")
    List<CityLineScopeEntity> findByCityCode(String cityCode, int innercityLine);


    CityLineScopeEntity findByIdCityLine(String idCityLine);

    @Query("select t from CityLineScopeEntity t left join CityLineEntity c on t.idCityLine = c.idCityLine where c.cityCode=:cityCode")
    List<CityLineScopeEntity> findByCityCode(String cityCode);

}
